/*
 * @lc app=leetcode.cn id=368 lang=cpp
 *
 * [368] 最大整除子集
 */

// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class Solution
{
    struct Node
    {
        int label;
        vector<Node *> children;
        Node(int n) : label(n) {}
    };

public:
    vector<int> largestDivisibleSubset(vector<int> &nums)
    {
        if (nums.size() == 1)
            return nums;

        std::sort(nums.begin(), nums.end());

        vector<Node> nodes(2000);
        for (size_t i = 0; i < nodes.size(); i++)
        {
            nodes[i].label = i;
        }
        
        for (size_t i = 0; i < nums.size(); i++)
        {
            for(int j = i + 1; j < nums.size(); j++)
            {
                if(nums[j] % nums[i])
                {
                    nodes[nums[i]].children.push_back(&nodes[nums[j]]);
                }
            }
        }
        


    }
};
// @lc code=end
